<?php

session_start();
ob_start();
date_default_timezone_set('PRC');
//var_dump($_POST);exit;
$error='';
$title = $_POST['title'];
$price = $_POST['price'];
$days = $_POST['days'];
$startingPoint = $_POST['startingPoint'];
$vehicle = $_POST['vehicle'];
$introduce = $_POST['introduce'];
$schedule = $_POST['schedule'];
$hint = $_POST['hint'];


	//将内容插入到数据库中
	if(empty($error)){
		include '../config.php';
		$link=mysql_connect(HOST,DBUSER,DBPASS) or die('数据库连接失败');
		mysql_select_db(DBNAME,$link);
		mysql_set_charset('utf8');
		if(empty($error)){
			$sql= "update t_plan set  title='".$title."',
			price='".$price."',days='".$days."',startingpoint='".$startingpoint."',vehicle='".$vehicle."',introduce='".$introduce."',schedule='".$schedule."',hint='".$hint."' where id=".$_POST['id'];
			$result=mysql_query($sql);
			echo $sql;
		}
		mysql_close($link);
	}
	//错误跳转
	if(empty($error)){
		header('Location:planList.php?tid='.$tid.'&title='.$title);
	}else{
		header('Location:planSreach.php?error='.$error.'&title='.$title.'&begin='.$begin);
	}
	ob_end_flush();
	?>